<section class="content-header">
    <h1>&nbsp;</h1>
    <ol class="breadcrumb">
        <li><a href="javascript:void(0);"><i class="fa fa-dashboard"></i>
            告警配置</a></li>
        <li class="active">Exchange告警配置</li>
    </ol>
</section>
<!-- Main content -->
<section class="content" >

    <div class="row"  ng-controller="exchangeCtrl" >
        <div class="col-xs-12">
            <div class="box">

                <div class="box-body" style=" ">
                    <div   class="col-sm-offset-1 col-sm-10"  >
                        <form name="exchangeForm" class="row form-horizontal" ng-submit="update(exchangeForm.$valid)"  validate>
                            <div class="form-group">
                                <label  class="col-sm-2 control-label  ">是否启用</label>
                                <div class="col-sm-4">
                                    <div class="checkbox">
                                        <label>
                                            <!--<input type="radio" name="enabled"   data-ng-model="obj.enabled"
                                                   ng-value="true" checked> 是
                                            <input type="radio" name="enabled"   data-ng-model="obj.enabled"
                                                   ng-value="false" checked> 否-->
                                            <input type="checkbox" name="enabled" data-ng-model="obj.enabled" ng-true-value="true"
                                                   ng-false-value="false"     > 启用
                                        </label>
                                    </div>
                                </div>
                            </div>
                            <div class="form-group">
                                <label  class="col-sm-2 control-label  ">数据中心</label>
                                <div class="col-sm-6">
                                    <div class="checkbox" data-ng-repeat="area in areas track by $index" style="display: inline-block;margin-right: 15px;">
                                        <label>
                                            <input type="checkbox" name="area"   value="{{area.code}}"  > {{area.code}}
                                        </label>
                                    </div>

                                </div>
                            </div>
                            <div class="form-group"   >
                                <label  class="col-sm-2 control-label  ">检测周期</label>
                                <div class="col-sm-4"   >
                                    <input  type="text" class="form-control"  data-ng-model="obj.alarmCron"
                                            placeholder="请输入检测周期"    required>

                                </div>
                                <label   class=" col-sm-4 control-label text-info" style="text-align: left;"><small><a href="{{$root.configs.cron_expressions_url}}" target="_blank">点击查看表达式规则</a></small></label>
                            </div>

                            <div class="form-group">
                                <label  class="col-sm-2 control-label  ">告警方式</label>
                                <div class="col-sm-4">
                                    <div class="checkbox">
                                        <label>
                                            <input type="checkbox" name="alarmWay" data-ng-model="obj.alarmWay[0]" ng-true-value="'EMAIL'"
                                                   ng-false-value="''"    disabled> Email
                                        </label>
                                    </div>
                                </div>
                            </div>
                            <div class="form-group item"  data-ng-repeat="email in emails track by $index">
                                <label  class="col-sm-2 control-label  ">Email({{$index+1}})</label>
                                <div class="col-sm-4"   >
                                    <div class="input-group">
                                        <input  type="email" class="form-control"   data-ng-model="emails[$index]"
                                                placeholder="请输入Email地址"     >
                                        <div class="input-group-btn">
                                            <a href="javascript:void(0);" class=" btn btn-default  "  ng-click="plusEmail();" ><span class="glyphicon glyphicon-plus"></span></a>
                                            <a href="javascript:void(0);" class=" btn btn-default    "  ng-click="minusEmail($index);" ><span class="glyphicon glyphicon-minus"></span></a>
                                        </div><!-- /btn-group -->
                                    </div>
                                </div>
                                <label   class="col-sm-4 control-label text-info" style="text-align: left;"><small>用于接收告警邮件的Email地址</small></label>
                            </div>

                            <div class="form-group">
                                <div class="col-sm-offset-2 col-sm-4">
                                    <button type="submit" id="btnSave" class="btn btn-success"   >保存</button>
                                </div>
                            </div>
                        </form>
                        <div class="row" style="margin-top:50px;">

                            <div class="col-sm-offset-1 col-sm-7">
                                <div class="panel panel-info " style="padding-left:0;margin-left:0;">
                                    <div class="panel-heading">
                                        功能描述
                                    </div>
                                    <div class="panel-body">
                                        <p> 检测云链默认Exchange是否在RabbitMQ中真实存在；以及是否创建了默认绑定关系。</p>
                                    </div>
                                </div>
                            </div>

                        </div>
                    </div>

                </div>
                <!-- /.box-body -->
            </div>
            <!-- /.box -->
        </div>
    </div>

</section>